import java.util.ArrayList;
import java.util.Scanner;

public class test {
    public static void main(String[] args) {
        ArrayList<Student> studentlist = arraylist.studentlist();
        while (true) {
            //1.用输出语句完成主界面的编写
            System.out.println("--------欢迎来到学生管理系统---------");
            System.out.println("1.添加学生");
            System.out.println("2.删除学生");
            System.out.println("3.修改学生:id为2，年龄+1");
            System.out.println("4.查看所有学生");
            System.out.println("5.退出");
            System.out.println("请输入你的选择");

            // 2.用scanner实现键盘录入数据
            Scanner sc = new Scanner(System.in);
            String line = sc.nextLine();

            //3.用swith语句完成操作的选择
            switch (line) {
                case "1":
//                    System.out.println("添加学生");
                    add.add_student(studentlist);
                    break;
                case "2":
//                    System.out.println("删除学生");
                    delete.delete_student(studentlist);
                    break;
                case "3":
//                    System.out.println("修改id为2的学生，年龄加1");
                    is_exist.is_id_2(studentlist);
                    select.select_all(studentlist);
                    break;
                case "4":
//                    System.out.println("查看所有学生");
                    select.select_all(studentlist);
                    break;
                case "5":
                    System.out.println("谢谢使用");
//                    break;
                    System.exit(0); //JVM退出

            }
        }
    }
}
